<?php
/**
 * Copyright (C), 2021-2021, Shall Buy Life info. Co., Ltd.
 * FileName: ${FILE_NAME}
 * Description: 说明
 *
 * @author lwl
 * @Create Date    2021/12/10 20:44
 * @Update Date    2021/12/10 20:44 By lwl
 * @version v1.0
 */

namespace Example\Services\Processor\Order;

use Illuminate\Http\Response;
use YiluTech\YiMQ\Processor\EcProcessor;


class OrderPayCallback extends EcProcessor
{
    protected function validate($validator)
    {
        $validator([
            'ordersn' => 'required',
        ]);
    }

    /**
     * FunctionName：do
     * Description：
     * Author：lwl
     * @return bool[]|false[]
     */
    protected function do()
    {
        $data = $this->data;
        $result = OrderService::getInstance()->callBack($data);
        if ($result['code'] != Response::HTTP_OK) {
            return ['result' => false];
        }
        return ['result' => true];
    }
}
